<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>构造函数的继承</title>
	<link rel="stylesheet" href="">
</head>
<body>
	<script>
		function father(name,age) {
			this.name = name
			this.age = age
			// console.log(this) // 指向father实例对象
			this.say =  function() {
				console.log('这是父类的方法')
				// console.log(this) // 指向father实例对象
			}
		}
		function son(name,age) {
			console.log(this)
			this.song = function() {
				console.log('这是子类的方法')
			}
			father.call(this,name,age)
		}
		// var f = new father('zs',11)
		// console.log(f.name + f.age)
		// f.say()
		var s = new son('ww',12)
		console.log(s.name + s.age)
		s.song()
		s.say()
	</script>
</body>
</html>